package net.googlecode.demenkov.task4.utils;

import net.googlecode.demenkov.task4.source.StringUtil;

/**
 * StringUtil that changes all letters 'A' or 'a' to '!' in inputstring.
 *
 * @author Yura Demenkov
 * @since 04.04.11
 */
public class ChangeLettersA extends StringUtil {
    public ChangeLettersA(String inputstring) {
        super(inputstring);
    }

    /**
     * Changes all letters 'A' or 'a' to '!' and log this action.
     *
     * @return String, where 'A' or 'a' changed to '!'.
     */
    public String ChangeA() {
        String outputString = new String();
        outputString = inputString.replaceAll("A", "!");
        outputString = outputString.replaceAll("a", "!");
        this.LogMessage(outputString, "Change all letters 'A' or 'a' to '!'.");
        return outputString;
    }
}
